package com.redstar.HappyRefresh.pojo;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;

@Data
@EqualsAndHashCode(callSuper = false)
public class Favorites implements Serializable { // 收藏夹
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @TableLogic
    private Boolean isDeleted; // 逻辑删除, 0未删除, 1删除, 默认为0

    @TableField(fill = FieldFill.INSERT)
    private Date gmtCreated; // 生成时间，自动填充

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date gmtUpdated; // 修改时间，自动填充

    @NotBlank(message = "得给你的收藏夹取个名字吧?")
    private String name;

    private String description;

    private Long userId;

    // 收藏夹下的视频总数
    @TableField(exist = false)
    private Long videoCount;
}
